<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script lang="javascript">
    // 上拉加载的本质是页面触底，或者快要触底的动作
    //判断页面触底：
    // scrollTop+clientHeight>=scrollHeight
    let clientHeight = document.documentElement.clientHeight;
    let scrollHeight = document.body.scrollHeight;
    let scrollTop = document.documentElement.scrollTop;

    let distance = 50;
    if((scrollTop+clientHeight)>=(scrollHeight-distance)){
      console.log('开始上拉加载数据');
    }
  </script>
</body>
</html>